package com.molichuxing.services.infrastructure.dto.response;


import com.molichuxing.framework.dto.ResponseRootDto;
import com.molichuxing.services.property.EscrowLogTypeEnum;
import com.molichuxing.services.property.PaymentChannelEnum;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 第三方支付调用日志
 *
 * @Author zoumingyu
 * @Date 2020年03月31日
 */
@Data
public class EscrowLogDto extends ResponseRootDto {
    private static final long serialVersionUID = 7623642240787390635L;

    /**
     * 付款流水号
     */
    private String payNumber;

    /**
     * 请求参数
     */
    private String requestData;

    /**
     * 响应参数
     */
    private String responseData;

    /**
     * 支付渠道
     */
    private PaymentChannelEnum channel;

    /**
     * 请求类型
     */
    private EscrowLogTypeEnum type;

    /**
     * 说明备注
     */
    private String remark;

    /**
     * gmt_create
     */
    private LocalDateTime gmtCreate;

    /**
     * gmt_modified
     */
    private LocalDateTime gmtModified;

    public EscrowLogDto setChannel(Integer channel) {
        this.channel = channel == null ? null : PaymentChannelEnum.getEnum(channel);
        return this;
    }

    public EscrowLogDto setType(Integer type) {
        this.type = type == null ? null : EscrowLogTypeEnum.getEnum(type);
        return this;
    }
}
